package jsu.blogger.mapper;

import jsu.blogger.pojo.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TagsMapper {
    @Select("select * from blog_system_database.tags")
    @Results({
            @Result(property = "tagId",column = "tag_id"),
            @Result(property = "tagName",column = "tag_name")
    })
    List<Tag> selectAllTags();

    @Select("select tag_name from blog_system_database.tags where tag_id=#{tagId}")
    String selectTagNameByTagId(Long tagId);
}
